﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PhysicsEngine.Common;
using PhysicsEngine.Dynamics;

namespace PhysicsEngine.Collision.Shapes
{
  public class Edge : IShape
  {

    public Vector2 V1 { get; private set; }
    public Vector2 V2 { get; private set; }

    public Edge(Vector2 v1, Vector2 v2)
    {
      Contract.Ensures(V1 == v1);
      Contract.Ensures(V2 == v2);

      V1 = v1;
      V2 = v2;
    }

    public void Render()
    {
      throw new NotImplementedException();
    }

    /// <summary>
    /// Edges in this engine will all simulate terrain, so the resultant mass data should represent an infinite mass.
    /// </summary>
    /// <returns>A MassData object that simulates infinite mass.</returns>
    public MassData ComputeMass(float density)
    {
      Contract.Ensures(Contract.Result<MassData>().Mass == 0);
      Contract.Ensures(Contract.Result<MassData>().InverseMass == 0);

      return new MassData(0);
    }
  }
}
